Skip to content

Conversation

@EhabY
Copy link
Collaborator

@EhabY EhabY commented Dec 19, 2025

When opening a workspace via URI without a token, ensure we prompt for login and set the deployment before attempting to open. Extract URI handler into dedicated module with route-based dispatch.

Closes #680

When opening a workspace via URI without a token, ensure we prompt for
login and set the deployment before attempting to open. Extract URI
handler into dedicated module with route-based dispatch.
@EhabY EhabY requested a review from code-asher December 19, 2025 21:22
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, verified the token prompt shows up when the token is invalid or missing.

Comment on lines 163 to 165
if (token !== null) {
await secretsManager.setSessionAuth(safeHostname, { url, token });
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we wait to set the token until after ensureLoggedIn? To avoid potentially storing an invalid or blank token.

Not a huge deal since usually the token should be set and valid, I just noticed that if I am already logged in and the URI contains an invalid or blank token, I get partially logged out (my workspace list is empty but I still look logged-in) and if I reload VS Code I am completely logged out. Just seems unfortunate to lose the perfectly good token I had stored previously.

Actually ensureLoggedIn already sets auth so I suppose we can skip it here. Although, it also sets it before validating. Maybe something we can visit later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh that's a valid point, I've added an optional token parameter so we try to login in the following order:

  1. mTLS (non-token auth)
  2. Provided token
  3. Stored token
  4. User prompt

We store whatever succeeds in this order

* Always return User if the login is successful
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing login prompt if URI handler is missing the token

2 participants